<script setup>
// 新闻详情
// 新闻动态点击新闻进入新闻详情
import { newinfoApi } from '../../api/index'
import { ElMessage, ElMessageBox } from 'element-plus'
import { ref, onMounted } from 'vue'
import { useRouter,useRoute } from 'vue-router'
const route = useRoute()
const id = ref(route.query.id)
const data = ref({})
const getinfo = async function () {
    const msg = await newinfoApi({
        Id:id.value
    })
    if (msg.data.code == 0) {
        data.value = msg.data.data
    }
}
onMounted(() => {
    getinfo()
})
</script>
<template>
    <div class="banner"></div>
    <div class="main">
        <div class="news_left s20">
            <div class="left_box">
                <div class="main_box2">
                    <div class="tou">
                        <h1 class="tou_h1">{{data.title}}</h1>
                        <div class="laizi">
                            <div class="fr">作者：{{data.author}}&nbsp;&nbsp;&nbsp;&nbsp;{{ data.updated }}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                            <div class="zh">点击量：{{ data.click }}</div>
                        </div>
                    </div>
                    <div class="details_box" style="margin-top: 50px;">
                       <div v-html="data.text"></div>
                    </div>
                
                    <div style="clear:both;"></div>
                </div>
            </div>

        </div>
    </div>
    <div style="clear:both"></div>
</template>
<style scoped></style>
